import axios from '@/libs/request/axios'

/**
 * 获取预审批数据-多条件
 * @param params
 * @returns {*}
 */
export const getListData = (params) => {
    return axios.request({
        url: '/apply/preApprove/getByCondition',
        method: 'POST',
        data: params,
    })
}

/**
 *新增预审批,生成二维码
 * @param obj
 * @returns {*}
 */
export function save(obj) {
    return axios.request({
        url: '/apply/preApprove/save',
        method: 'POST',
        data: obj
    })
}

/**
 * 暂存数据,生成二维码
 * @param obj
 * @returns {*}
 */
export function store(obj) {
    return axios.request({
        url: '/apply/preApprove/store',
        method: 'POST',
        data: obj
    })
}

/**
 * 修改预审批信息
 * @param obj
 * @returns {*}
 */
export function edit(obj) {
    return axios.request({
        url: '/apply/preApprove/edit',
        method: 'POST',
        data: obj
    })
}

/**
 * 删除预审批信息
 * @param id
 * @param params
 * @returns {*}
 */
export const deletePreApprove = (params) => {
    return axios.request({
        url: `/apply/preApprove/delete`,
        method: 'DELETE',
        data: params,
    })
};

/**
 *
 * @param params
 * @returns {*}
 */
export const getToken = () => {
    return axios.request({
        url: `/apply/preApprove/getToken`,
        method: 'POST',
        // data: params,
    })
};

/**
 * MQ
 * @param id
 * @param params
 * @returns {*}
 */
export const preApproveMessageSender = (params) => {
    return axios.request({
        url: `/apply/pre/preApproveMessageSender`,
        method: 'POST',
        data: params,
    })
};
/**
 *修改删除标识
 * @param id
 * @param params
 * @returns {*}
 */
export const editPreApprove = (id, params) => {
    return axios.request({
        url: `/apply/preApprove/edit/${id}`,
        method: 'POST',
        params: params,
    })
}
/**
 * 刷新二维码
 * @returns {*}
 */
export const refresh = (params) => {
    return axios.request({
        url: `/apply/preApprove/refresh`,
        method: 'POST',
        data: params,
    })
}
